class CertType {
  constructor(type,filters={}) {

    this.certTypeList = [];
    this.allCertType = [];
    this.areaCerTypeList = [];
    this.ranks = {};
    this.dataName = {};
    this.certTypeMap = {};
    this.areas = ["华东", "华南", "华西", "华北", "华中"];
    let init = () => {

      let list = _Setting.loadCertType(type);
      this.certTypeList = list;
      (list || []).forEach(item => {
        this.certTypeMap[item.code] = item;
        item.filter = filters[item.code];
      });
      this.allCertType = list.filter(item => item.area == "all");
      this.areaCerTypeList = list.filter(item => item.area == "area");
      // let areaList = certTypeList.filter(item=>item.area="area");
      // this.areas.forEach(area=>{
      //   let tempList = JSON.parse(JSON.stringify(areaList));
      //   (tempList||[]).forEach(item=>item.area=area)
      //   this.certTypeMap[area] = tempList;
      // })
    };
    init();
  }
}
